class Student {
  protected name: string;
  private age: number;
  protected readonly sex: boolean;
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
    this.sex = true;
  }

  getName() {
    return this.name;
  }
}

class P extends Student {
  constructor(name: string, age: number) {
    super(name, age);
  }
  getName(): string {
    return super.name;
  }
}

const student = new Student("lx", 18);

const p = new P("lsq", 19);

student.getName();

// proteced可以在继承中访问，实例对象中private protected都不能访问
